Temitope FALADE's profile

HOUDINI - PARTICLES SIMULATION PART 3 (DISINTEGRATION)

HOUDINI - PARTICLES SIMULATION 3
(MORE CONCEPTS)
INTRODUCTION
In this module, we will discuss disintegration effect and a couple of other concepts. There are different ways we can achieve a disintegration effect, but the general idea is that we have an object or a geometry in the start, and then the geometry is going to gradually disappear as it emits particles until we don't see the geometry anymore.

We are going to look at the simplest way this can be done, and then later look at a more advanced simulation, so let's get right into it.
SIMPLE DISINTEGRATION
We will start afresh with an empty scene. We will do this inside a geometry node, so let's create a new geometry and rename it as "disintegration", and dive right into it's SOP level.
To create the disintegration effect, we are going to need two objects. The first one is the object we want to disintegrate, and the second one is going to serve as a guide for the disintegration effect. The idea here is to transform the guide geometry on to the object we want to disintegrate.
As usual, let's create a simple sphere and increase it's resolutions. This is the object we want to disintegrate.
Note: We can use any geometry we like as the object we want to disintegrate, but we must make sure it is an air-tight closed volume geometry.
Next, let us create another sphere geometry and distort it with a mountain node, and a transform node to be able to transform it around. We will also make it slightly bigger than the first sphere. This is the guide geometry. 

Right now, this is what we have:
Now, let us animate the guide geometry on to the object we want to disintegrate. 

At it's current position, we will set a keyframe. Then after say 30 frames, we will move it until it sits right on top of the object we want to disintegrate, making sure it totally envelopes it.
Next, let's add a Boolean node.
This Boolean is going to subtract geometry A (the object to be disintegrated) from geometry B, so we will get something like below:
We will add another Boolean node to create a seam at the point of intersection between the two geometries. We will set the operation on the new Boolean to seam. 

We also got rid of the merge node to keep things clean.

We should have something like this now:
Now as we have guessed, we will use this seam as the source of our particles. 

So let's drop a popnet node and connect the Boolean seam output to it.
Right now, this is what we are getting:
Let's jump into the popnet node to make things more interesting.

Let's add a global wind force node, and set it's parameters like below:
Let's add more particles to the simulation by selecting the pop source and increasing it's constant birth rate:
Right now, the particles are being emitted from the surface of the disintegrating sphere. 

There are so many things we can do to make this effect even cooler. For example, we can add some pop forces and pop drags to affect the motion of the particles. 

Also  we can do a setup whereby the particles also emit from within the volume of the sphere to make it more compact.

Let's look into those now.
Firstly, the seam we are using now is a closed curve, so let's connect a polyfill node to fill the gaps.​​​​​​​
Then let's add a scatter node to scatter some points on the resulting mesh. We will crank up the number of total points to 10,000.
On the pop source node, we will change the emission type to use all points.
To modify the behaviour and motion of the particles, we will add pop drag, pop force, and pop group nodes in the following manner:
We used the pop group to strip out some particles whose ages exceed 1.5 so that they can gain more noise than the rest of the particles.

We should now have the following result:
A DIFFERENT APPROACH
We can actually approach the disintegration effect in a fairly similar approach, but instead of using Boolean seam like we did above, we can use Color instead. Let's see how to do this.

Firstly, let's delete some nodes in the SOP level until we have something like this:
Now, let's add color nodes to both the sphere and the guide geo. We will set the sphere color to blue and the guide to red:
Now, let's use an attribute transfer node to transfer the red color from the guide on to the blue sphere at the points where the guide sphere intersects the sphere (you can generally use this node to transfer any type of attribute from one object to another).

This point of intersection is where we will emit our particles from.
We will do the following settings on the attribute transfer node (this is subjective depending on your scene):
Now we will see the red color being transferred on to the sphere at the points of intersection.
Next, we want to scatter some points at that point of intersection on the blue sphere (that is, the red parts). To do this, let's connect a scatter node to the output.
By default, this scatter node will scatter points all over the sphere irrespective of the color. So let's change some settings on this node to only scatter points on the red parts;
We got a few points scattered on to the blue parts, but that is OK because these are negligible.

Finally, we will connect the output to the popnet.
The only thing we will change here is the emission type on the pop source (let's leave the pop drag, pop force, and pop group nodes as they were in the previous section unless you want to achieve a different kind of effect).

Also, let's animate the Activation such that the particles should only start emitting at exactly the frame when the sphere starts to disintegrate so that things match properly. In our case, the sphere only starts to dissolve from frame 26, so let's activate the particles on frame 26.

Then we can also play around with the total number of particles until we are satisfied with the results.
PARTICLES AND PYRO
As a bonus topic, we are going to discuss in this section how we can use fluids to emit particles and vice versa.

To demonstrate this, let us create a simple smoke effect.
We will start in a fresh new scene and create a new geometry node renamed "emitter" and enter it's SOP level. We will do a basic pyro cryogenic smoke setup as follows (refer to the basic pyro module to learn how to set this up:
If we connect a points from volume node to the pyro solver output, we can actually convert this smoke into points in 3D space.
And like we can guess, these points can be used as particles source. 

So if we connect a popnet node and enter into the popnet node, we can change the pop source emission type to 'points'.
Now we have particles being emitted from the pyro volumes.
Emitting volumes from particles is pretty much a similar step. As we know, we need points to be able to generate volumes, all we need to do is first emit our particles the usual way. 
Since particles are points, we just need to convert these points into pyro source in the SOP level.

We will connect a pyro source to the output, and then choose 'source smoke' in the initialize, and leave the mode at 'keep input'. We will not use a temperature attribute as well since the smoke motion would depend on the motion of the particles.
Then if we complete the rest of the pyro nodes setup, rasterizing the necessary attributes, we would have successfully converted our particles into volumes.
Working interchangeably between particles and fluids can be seamless, and depending on the type of effect we want to achieve, we can always come up with creative ways to blend these two systems together.
PARTICLES ALONG A CURVE
Let's quickly examine how we can make particles flow along a curve.

Let's start by creating the curve path first. Create a geometry node named "curve path" and enter it's SOP level. 

Create a Curve Bezier node. This node is used for creating curves. If we select it, we can see the different operations available on it. 

To start drawing a curve, select the Curve Bezier node, hover your mouse to the viewport and press ENTER to start drawing.

As you can see below, there are shortcuts for changing into the different Modes of the curve:

F - Edit Mode (whereby you can adjust the position of the points and their tangent handles)
G - Draw Mode (Whereby you can get back into drawing the curves in the viewport)

And so on... Follow the Instructions on the viewport to know how to navigate and modify the curves.
After creating the path, connect a null output node.
Now let's create the basic popnet setup;
Let's write the VEXpression: $F < 2 in the Impulse Activation so that the particles are emitted just once. 
To make the particles flow along a curve, we will create a pop curve force node to do just that.
On the pop curve node, let us reference the null output of our curve path into the SOP field.
We can then tweak the settings on this node to get different kinds of results. 

If we play the simulation, we will see that nothing happens. To make sure this works, position the curves (or particles) such that it is at the entry point of the suction tube created in the viewport:
You can reshape the tube under the 'shape' tab. As long as the particles are positioned at the entrance of the tube, it should work.

Now if we play the simulation, we will see the particles flow along the tube path.
CONTROLLING PARTICLES WITH TEXTURE MAPS
Another cool thing we can do with particles is using texture maps to drive them.

Let's look at a simple setup to see how that works.

Let's create a grid inside a geometry node.

Then to assign a texture map to the grid, we will use an attribute from map node. This node basically creates a color attribute for the grid.
If we load in an image texture, it will currently not make any sense on the grid. In order to see the textures properly, we will need to crank up the subdivisions on the grid. These subdivisions will act like pixels for the texture maps.

NOTE: Try not to overkill your geometry with excessive subdivisions. A reasonable amount of subdivisions should be good enough.
If we are using a geometry that already has UV (for instance an imported FBX or Alembic model), what we need to do is to remove the "uv" in the UV attribute flag on the attribfrommap node and the texture map should project properly on the model.
Now that we have a color attribute, we can connect a popnet node, and if we play the simulation, we will see that the particles will inherit the color information from the texture map on the model.
In the pop source Emission Attribute dropdown, we can choose color, and the particles will only emit from the parts where we have color information on the texture map.
If we have a pure black color on the texture map, no particles would be emitted from those black parts.
If we add velocity to the particles now, they will move according to the velocity, and we can modify the behavior and movements of the particles like before.
If we have animated texture sequence, we can also use that as well to create some really cool effects with the particles (make sure to check on the 'show sequence as one entry' when choosing the image sequence.
If you want to loop the image sequence, you can use a time warp node.

Input the frame range (0 - 23) and set post to cycle. The image texture will now loop.
And in turn, the generated particles would be generated from the animated color information in the texture sequence.
HOUDINI - PARTICLES SIMULATION PART 3 (DISINTEGRATION)
Published:

Owner

HOUDINI - PARTICLES SIMULATION PART 3 (DISINTEGRATION)

Published: